home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 201 / DPCS1104.ISO / Full / QuickBooks / QBTutor / Lesson5 / Lesson5.dcr / 00166_field Tab handler.ls < prev    next >
Encoding:
Text File  |  2001-02-01  |  977 b   |  36 lines

  1. property spriteNum, preTab, postTab
  2.  
  3. on getPropertyDescriptionList
  4.   description = [:]
  5.   addProp(description, #preTab, [#default: -1, #format: #integer, #comment: "Backtab:"])
  6.   addProp(description, #postTab, [#default: -1, #format: #integer, #comment: "Tab:"])
  7.   return description
  8. end
  9.  
  10. on keyDown me
  11.   if the key = TAB then
  12.     if the shiftDown then
  13.       the keyboardFocusSprite = preTab
  14.       sendSprite(preTab, #amIpreLegal)
  15.     else
  16.       the keyboardFocusSprite = postTab
  17.       sendSprite(postTab, #amIpostLegal)
  18.     end if
  19.   end if
  20.   pass()
  21. end
  22.  
  23. on amIpreLegal me
  24.   if (sprite(spriteNum).locV <= (0 - sprite(spriteNum).height)) or (sprite(spriteNum).locV >= 600) then
  25.     the keyboardFocusSprite = preTab
  26.     sendSprite(preTab, #amIpreLegal)
  27.   end if
  28. end
  29.  
  30. on amIpostLegal me
  31.   if (sprite(spriteNum).locV <= (0 - sprite(spriteNum).height)) or (sprite(spriteNum).locV >= 600) then
  32.     the keyboardFocusSprite = postTab
  33.     sendSprite(postTab, #amIpostLegal)
  34.   end if
  35. end
  36.